#{extends 'mobile_main.html' /}
#{set title:'我的' /}
<!-- 标题栏 -->
<header class="bar bar-nav">
    <a class="icon icon-me pull-left open-panel"></a>
    <h1 class="title">我的</h1>
</header>
<!-- 工具栏 -->
<nav class="bar bar-tab">
    <a class="tab-item external " href="/WxController/index">
        <span class="icon icon-code"></span>
        <span class="tab-label">扫描</span>
    </a>
    <a class="tab-item external active">
        <span class="icon icon-me"></span>
        <span class="tab-label">我的</span>
    </a>
</nav>
<!-- 这里是页面内容区 -->
<div class="content">
    <div class="buttons-tab">
        <a href="#tab1" class="tab-link active button">扫描记录</a>
        <a href="#tab2" class="tab-link button">工资结算</a>
    </div>
    <div class="content-block">
        <div class="tabs">
            <div id="tab1" class="tab active">
                <div class="content-block" id="smjl">
                    <script id="smjltpl" type="text-x-mustache-tmpl">
                        <div class="content-block-title">{{customer_car_info}}</div>
                        <div class="list-block">
                            <ul>
                                <li class="item-content">
                                    <div class="item-media"><i class="icon icon-f7"></i></div>
                                    <div class="item-inner">
                                        <div class="item-title">用户名</div>
                                        <div class="item-after">{{username}}</div>
                                    </div>
                                </li>
                                <li class="item-content">
                                    <div class="item-media"><i class="icon icon-f7"></i></div>
                                    <div class="item-inner">
                                        <div class="item-title">快递单号</div>
                                        <div class="item-after">{{express_number}}</div>
                                    </div>
                                </li>
                                <li class="item-content">
                                    <div class="item-media"><i class="icon icon-f7"></i></div>
                                    <div class="item-inner">
                                        <div class="item-title">操作</div>
                                        <div class="item-after">{{pname}} - {{process_name}} -{{process_price}}元</div>
                                    </div>
                                </li>
                                <li class="item-content">
                                    <div class="item-media"><i class="icon icon-f7"></i></div>
                                    <div class="item-inner">
                                        <div class="item-title">操作日期</div>
                                        <div class="item-after">{{created_date}}</div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </script>
                </div>
            </div>
            <div id="tab2" class="tab">
                <div class="content-block">
                    <p>待开发......</p>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        var user = localStorage.getItem("user");
        if(user) {
            user = JSON.parse(user);
            user = user.data;
        }
        var param = {"uid":user.user.id,"token":user.token};
        $.ajax({
            type:"POST",                      //请求类型
            url:"/apicontroller/getOrderDetailByUid",                 //URL
            data:param,                  //传递的参数
            dataType:"json",                 //返回的数据类型
            success:function(data){          //data就是返回的json类型的数据
                console.log(JSON.stringify(data));
                var list = data.data.list;
                var smjl=$("#smjltpl").html();
                $(list).each(function(index,elm){
                    $("#smjl").append(Mustache.render(smjl,{username:elm.username,customer_car_info:elm.customer_car_info
                    ,express_number:elm.express_number
                    ,pname:elm.pname
                    ,process_name:elm.process_name
                    ,created_date:elm.created_date
                    ,process_price:elm.process_price}));
                });
            }
        });
    });
</script>